package comits.business.tiers.dao;

import java.util.List;

import org.hibernate.SQLQuery;
import org.hibernate.context.ManagedSessionContext;

import comits.business.tiers.metiers.StatutCommande;
import comits.business.tiers.orm.hibernate.HibernateSession;

public class StatutCommandeDAOImpl implements StatutCommandeDAO{
	
	public List<StatutCommande> recupererStatutCmd() {
		SQLQuery sql = HibernateSession.currentSession().createSQLQuery(PropertiesConfig.Get("SelectAllStatutCmd")).addEntity(StatutCommande.class);
		
		/*SQLQuery sql = HibernateSession.currentSession()
		.createSQLQuery("select * from statutCommande")
		.addEntity(StatutCommande.class);*/
		List<StatutCommande> list = sql.list();

		ManagedSessionContext.unbind(HibernateSession.getSessionFactory());
		return list;
	}

}
